FieldManager = null;



_FieldManager = function() {
this.Login = null;
this.FirstName = null;
this.MiddleName = null;
this.SecondName = null;
this.Gender = null;
this.Age = null;
 }
_FieldManager.prototype = {
GetFields: function() {
		var _FieldUser = ClientCommandsManager.Get("GetUserInfoById");
		_FieldUser.id = $.cookie("uId");
		CloakManager.OnCloak(false,true);
	    ClientCommandsManager.Execute(_FieldUser, this.SuccessHandler, null);
	},
	SuccessHandler: function(data, status, request) {
		CloakManager.OffCloak(true,true);
		if(data){
			FieldManager.Login = data.login;
			FieldManager.FirstName = data.firstName;
			FieldManager.MiddleName = data.middleName;
			FieldManager.SecondName = data.secondName;
			FieldManager.Gender = data.gender;
			FieldManager.Age = data.age;
			$("#Login").val(FieldManager.Login);
			$("#FirstName").val(FieldManager.FirstName);
			$("#MiddleName").val(FieldManager.MiddleName);
			$("#SecondName").val(FieldManager.SecondName);
			$("#Age").val(FieldManager.Age);
		}
		else{
			var nItem = NotificationManager.CreateNotification("Error. User with such id don't exist", ["error"]);
    		NotificationManager.ShowMessages([nItem]);
		}
    }
}